package com.rui.builder.model;

import com.rui.builder.obj.Computer;

/**
 * 链式写法建造者类
 *
 * @author ZhangRui
 * @date 2023/03/02 15:00
 **/
public class SimpleComputerBuilder2 {

    private Computer computer = new Computer();

    public SimpleComputerBuilder2 buildMotherBoard(String motherBoard) {
        computer.setMotherboard(motherBoard);
        return this;
    }

    public SimpleComputerBuilder2 buildCpu(String cpu) {
        computer.setCpu(cpu);
        return this;
    }

    public SimpleComputerBuilder2 buildMemory(String memory) {
        computer.setMemory(memory);
        return this;
    }

    public SimpleComputerBuilder2 buildDisk(String disk) {
        computer.setDisk(disk);
        return this;
    }

    public SimpleComputerBuilder2 buildGpu(String gpu) {
        computer.setGpu(gpu);
        return this;
    }

    public SimpleComputerBuilder2 buildPower(String power) {
        computer.setPower(power);
        return this;
    }

    public SimpleComputerBuilder2 buildHeatSink(String heatSink) {
        computer.setHeatSink(heatSink);
        return this;
    }

    public SimpleComputerBuilder2 buildChassis(String chassis) {
        computer.setChassis(chassis);
        return this;
    }

    public Computer build() {
        return computer;
    }
}